import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Nav from '@/components/Nav'
import Welcome from '@/components/Welcome'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/welcome',
      children: [
        {
          path: '/welcome',
          name: 'Welcome',
          component: Welcome
        },
        {
          path: '/nav',
          name: 'Nav',
          component: Nav,
          redirect: '/guid',
          children: [
            {
              path: '/guid',
              name: 'Guid',
              component: r => require.ensure([], () => r(require('../docs/guid.md')))
            },
            {
              path: '/install',
              name: 'Install',
              component: r => require.ensure([], () => r(require('../docs/install.md')))
            },
            {
              path: '/quickstart',
              name: 'Quickstart',
              component: r => require.ensure([], () => r(require('../docs/quickstart.md')))
            },
            {
              path: '/updatelog',
              name: 'Updatelog',
              component: r => require.ensure([], () => r(require('../docs/updatelog.md')))
            },
            {
              path: '/button',
              name: 'Button',
              component: r => require.ensure([], () => r(require('../docs/button.md')))
            },
            {
              path: '/input',
              name: 'Input',
              component: r => require.ensure([], () => r(require('../docs/input.md')))
            },
            {
              path: '/switch',
              name: 'Switcch',
              component: r => require.ensure([], () => r(require('../docs/switch.md')))
            },
            {
              path: '/dialog',
              name: 'Dialog',
              component: r => require.ensure([], () => r(require('../docs/dialog.md')))
            },
            {
              path: '/calendar',
              name: 'Calendar',
              component: r => require.ensure([], () => r(require('../docs/calendar.md')))
            },
            {
              path: '/icon',
              name: 'Icon',
              component: r => require.ensure([], () => r(require('../docs/icon.md')))
            },
            {
              path: '/radio',
              name: 'Radio',
              component: r => require.ensure([], () => r(require('../docs/radio.md')))
            }
          ]
        }
      ]
    }
  ]
})
